﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gota.Common.Context;

namespace Gota.Common.Entities.UI
{
    [Serializable]
    public class GazetteerEntity
    {
        public int Id { get; set; }
        public string ContentData { get; set; }
        public string Language { get; set; }
        public string ParentCategory { get; set; }

        public static GazetteerEntity FromDB(Gazetteer gz)
        {
            GazetteerEntity ge = new GazetteerEntity
            {
                Id = gz.Id,
                ContentData = gz.ContentData,
                Language = gz.PrmLanguage.Name,
                ParentCategory = gz.GazetteerCategory.Name
            };

            return ge;
        }
    }
}
